<template>
  <div id="app">
    <h1>自动化脚本控制面板</h1>
    <button @click="runRetrieveFireworks">执行夜花作战</button>
    <button @click="runMainLineUpgrade">执行主线升级</button>
    <button @click="runHelloWorld">test</button>
  </div>
</template>

<script>
export default {
  methods: {
    async runRetrieveFireworks() {
      const response = await fetch('http://localhost:5000/run-retrieve-fireworks', {
        method: 'POST',
      });
      const result = await response.json();
      alert('夜花作战执行结果: ' + result.status);
    },
    async runMainLineUpgrade() {
      const response = await fetch('http://localhost:5000/run-main-line-upgrade', {
        method: 'POST',
      });
      const result = await response.json();
      alert('主线升级执行结果: ' + result.status);
    },
    async runHelloWorld() {
      const response = await fetch('http://localhost:5000/helloworld', {
        method: 'POST',
      });
      const result = await response.json();
      alert('test执行结果: ' + result.status);
    }
  }
};
</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  text-align: center;
  margin-top: 60px;
}
button {
  padding: 10px 20px;
  margin: 10px;
  font-size: 16px;
}
</style>